package com.pactera.madp.cp.api.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pactera.madp.common.core.constant.ServiceNameConstants;
import com.pactera.madp.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteDeptService {

    @GetMapping("/dept/getDeptsAndUsers/{deptId}")
    R getDeptsAndUsers(@PathVariable("deptId")Integer deptId);

    @GetMapping("/dept/getDeptsAndUsers")
    R getDeptsAndUsers(@RequestParam(name = "deptIds") List<Integer> deptIds);

    @GetMapping("/dept/getChildrens/{deptId}")
    R getChildrens(@PathVariable("deptId") Integer deptId);

    @PostMapping("/dept/getChildrenPage/{deptId}")
    R getChildrenPage(@PathVariable("deptId") Integer deptId, @RequestBody Page page);

    @PostMapping("/dept/getChildrenPageByObjectId/{deptId}")
    R getChildrenPageByObjectId(@PathVariable("deptId") Integer deptId, @RequestBody Page page,@RequestParam("objectId") Integer objectId);

    @GetMapping("/dept/getWxDeptId/{deptId}")
    R getWxDeptId(@PathVariable("deptId") Integer deptId);

    @PostMapping("/user/getUserPage")
    R getUserPage(@RequestParam(value = "name", required = false) String name, @RequestParam("deptId") Integer deptId, @RequestBody Page page);

    @PostMapping("/user/getUserPageByObjectId")
    R getUserPageByObjectId(@RequestParam(value = "name", required = false) String name, @RequestParam("deptId") Integer deptId, @RequestBody Page page,@RequestParam("objectId") Integer objectId);

    @GetMapping("/dept/selected-depts/{mobile}")
    R getSelectedDepts(@PathVariable("mobile") String mobile);

    @GetMapping("/dept/lower-depts/{deptId}")
    R getLowerDepts(@PathVariable("deptId") Integer deptId);

    @GetMapping("/dept/users/{deptId}")
    R getUsers(@PathVariable("deptId") Integer deptId);

    @GetMapping("/dept/getDescendantList/{deptId}")
    R getDescendantList(@PathVariable("deptId") Integer deptId);

    @GetMapping("/dept/getWxDeptIds")
    R getWxDeptIds(@RequestParam(name = "deptIds") List<Integer> deptIds);

    @GetMapping("/dept/depts")
    List<Map<String, Object>> depts(@RequestParam(name = "deptIds") List<Integer> deptIds);

    @GetMapping("/user/users")
    List<Map<String, Object>> users(@RequestParam(name = "userIds") List<Integer> userIds);

    @GetMapping("/dept/remote/{wxDeptId}")
    Integer deptId(@PathVariable("wxDeptId") Integer wxDeptId);

    @GetMapping("/dept/remote/getAllZhLine")
    List<Integer> getAllZhLine();


    @GetMapping("/dept/username-dept")
    List<String> getUserNameByDeptId(@RequestParam(value = "deptId") Integer deptId);

    @GetMapping("/dept/getAllChildrenOrgCode/{deptId}")
    R getAllChildrenOrgCode(@PathVariable("deptId") Integer deptId);


}
